//
//  main.m
//  OC_JiangMingjun
//
//  Created by apple on 16/4/29.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Person.h"
#import "AddressBook.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
        AddressBook * add = [[AddressBook alloc] init];
        
        Person *p1 = [Person personWithName:@"Lucy" sex:@"女" age:21 phoneNumber:@"123"];
        
        Person *p2 = [Person personWithName:@"Joe" sex:@"男" age:17 phoneNumber:@"456"];
        
        Person *p3 = [Person personWithName:@"Baby" sex:@"女" age:27 phoneNumber:@"789"];
        
        Person *p4 = [Person personWithName:@"Linda" sex:@"女" age:21 phoneNumber:@"000"];
        
        [add addPerson:p1];
        [add addPerson:p2];
        [add addPerson:p3];
        [add addPerson:p4];
        
        [add showAll];
        
        NSLog(@"%@",[add findPersonWithPhoneNum:@"456"]);
        
        [add addPerson:p4];
        
        [add changePersonWithName:@"Linda" phoneNum:@"012" sex:@"女" age:25];
        
        [add showAll];
        
        [add findPersonsWithSex:@"女"];
        
        [add showAll];
        
        [add release];
        
       
    }
    return 0;
}
